
#include "CoordMoveEnergy.h"
registerMooseObject("TrilobitaApp", CoordMoveEnergy);

template<>
InputParameters validParams<CoordMoveEnergy>()
{
  InputParameters params = validParams<Kernel>();
  params.addRequiredCoupledVar("vm_x",
                               "The x component of mesh velocity");
  params.addRequiredCoupledVar("vm_y",
                               "The y component of mesh velocity");
  params.addRequiredCoupledVar("vm_z",
                               "The z component of mesh velocity");                                                         
  return params;
}

CoordMoveEnergy::CoordMoveEnergy(const InputParameters & parameters) :
		Kernel(parameters),
		  _rho(getADMaterialProperty<Real>("solid_density")),
      _cp(getADMaterialProperty<Real>("specific_heat")),
      _vm_x(coupledValue("vm_x")),
      _vm_y(coupledValue("vm_y")),
      _vm_z(coupledValue("vm_z"))     
{
}

Real
CoordMoveEnergy::computeQpResidual()
{
  RealVectorValue vm;
  vm(0) = _vm_x[_qp];
  vm(1) = _vm_y[_qp];
  vm(2) = _vm_z[_qp];
 Real r = -vm*_rho[_qp].value()*_cp[_qp].value()*_grad_u[_qp]*_test[_i][_qp];
  return r;
}
Real CoordMoveEnergy::computeQpJacobian()
{
	RealVectorValue vm;
  vm(0) = _vm_x[_qp];
  vm(1) = _vm_y[_qp];
  vm(2) = _vm_z[_qp];
  return -vm*_rho[_qp].value()*_cp[_qp].value()*_test[_i][_qp]*_grad_phi[_j][_qp];
}
Real  CoordMoveEnergy::computeQpOffDiagJacobian(unsigned int jvar)
 {

	 
			 return 0;


 }

